//
//  LoginViewController.m
//  GuoBang
//
//  Created by fengshuai on 16/4/28.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "LoginViewController.h"

@interface LoginViewController ()<UITextFieldDelegate>

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupNVA];
    [self setupUI];
    [self setupData];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

- (void)setupNVA
{
    //设置navbar字体颜色
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];

    self.navigationController.navigationBar.barTintColor=[SEATools stringToColor:@"ff6d6d"];
    self.title=@"国帮";
  
}


- (void)setupData
{
    
    
}

- (void)setupUI
{
   
//    self.view.backgroundColor = RGBCOLOR(245, 245, 245);
    self.codeBtn.layer.cornerRadius = 5;
    self.codeBtn.layer.masksToBounds = YES;
    
    self.loginBtn.layer.cornerRadius = 5;
    self.loginBtn.layer.masksToBounds = YES;
    
    [self.codeBtn addTarget:self action:@selector(codeAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.loginBtn addTarget:self action:@selector(loginAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
    self.phoneTF.delegate = self;
    self.codeTF.delegate = self;
    
}


- (void)codeAction:(UIButton *)sender
{
    
}

- (void)loginAction:(UIButton *)sender
{
    //创建NAV
    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:[ChartController new]];
    //设置navbar字体颜色
    [nav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
    //设置navbar背景色
    nav.navigationBar.barTintColor=[SEATools stringToColor:@"ff6d6d"];
    [UIApplication sharedApplication].keyWindow.rootViewController=nav;
    //[self.navigationController popViewControllerAnimated:YES];
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
    
}



@end
